package com.han.school.service.impl;

import com.han.school.mapper.UserMapper;
import com.han.school.pojo.User;
import com.han.school.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired private  UserMapper userMapper;
    @Override
    public int insert(User record) {
        return userMapper.insert(record);
    }

    @Override
    public User selectByName(String username) {
        User user = userMapper.selectByName(username);
        return user;
    }

    @Override
    public int changePassword(User record) {

        return  userMapper.updateByPrimaryKey(record);
    }

    @Override
    public User findUser(User user) {
        return userMapper.findUser(user);
    }

    @Override
    public int changePassword(User record) {
        return  userMapper.updateByPrimaryKey(record);
    }

}
